/* eslint-disable */
import request from "@/request";

/** addToCart POST /api/api/shopPart/cart/add */
export async function addToCartUsingPost(
  body: API.ShoppingCartItem,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>("/api/api/shopPart/cart/add", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** getCartItems GET /api/api/shopPart/cart/list */
export async function getCartItemsUsingGet(options?: { [key: string]: any }) {
  return request<API.BaseResponseListShoppingCartItemVO_>(
    "/api/api/shopPart/cart/list",
    {
      method: "GET",
      ...(options || {}),
    }
  );
}

/** 获取按商户分组的购物车商品列表 GET /api/api/shopPart/cart/list/byStore */
export async function getCartItemsByStoreUsingGet(options?: {
  [key: string]: any;
}) {
  return request<API.BaseResponseListStoreCartGroupVO_>(
    "/api/api/shopPart/cart/list/byStore",
    {
      method: "GET",
      ...(options || {}),
    }
  );
}

/** removeFromCart POST /api/api/shopPart/cart/remove */
export async function removeFromCartUsingPost(
  body: API.ShoppingCartItem,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>("/api/api/shopPart/cart/remove", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** updateQuantity POST /api/api/shopPart/cart/update/quantity */
export async function updateQuantityUsingPost(
  body: API.ShoppingCartItem,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>(
    "/api/api/shopPart/cart/update/quantity",
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    }
  );
}

/** updateSelected POST /api/api/shopPart/cart/update/selected */
export async function updateSelectedUsingPost(
  body: API.ShoppingCartItem,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>(
    "/api/api/shopPart/cart/update/selected",
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    }
  );
}
